<?php
//富文本编辑器 图片上传接口

if(!$_FILES){
	
	
	die('无效参数');
}

$res =array();

$res['errno'] =  0;

$destionation =  dirname(__FILE__)."/uploads/".date('Ymd');//指定存放目录
$url = "/uploads/".date('Ymd') ;

if(!is_dir($destionation)){

mkdir($destionation, 0777);
	
}
	
$i=0;
foreach($_FILES as $key=>$a){

	
	move_uploaded_file($a['tmp_name'],$destionation.'/'.$a['name']);
	
	$res['data'][$i]= $url.'/'.$a['name'];
	$i++;
}



echo  json_encode($res);
die();
